package com.situ.web.servlet;

import com.situ.web.dao.IStudentDao;
import com.situ.web.dao.ITeacherDao;
import com.situ.web.dao.impl.StudentDaoImpl;
import com.situ.web.dao.impl.TeacherDaoImpl;
import com.situ.web.pojo.Student;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

//url模式(url-pattern)
@WebServlet("/teacher")
public class TeacherServlet extends HttpServlet {
    private ITeacherDao teacherDao = new TeacherDaoImpl();
    private IStudentDao studentDao = new StudentDaoImpl();


    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("TeacherServlet.service");
        List<Student> list = studentDao.selectAll();
    }
}
